@echo off
:: 生成英文日期 yyyy-MM-dd
for /f "usebackq tokens=1" %%d in (`powershell -NoProfile -Command "Get-Date -Format 'yyyy-MM-dd-hh-mm'"`) do set "datestr=%%d"

:: 找到 Git Bash 的绝对路径
set bash_path=
for /f "delims=" %%i in ('where git') do set "git_exe=%%i"
if not defined git_exe (
    echo Git not found. Please install Git for Windows.
    pause & exit /b 1
)
:: 把 git.exe 换成 bin\bash.exe
set bash_path=%git_exe:\cmd\git.exe=\bin\bash.exe%

:: 在当前仓库打开 Bash，一次性执行三条命令
"%bash_path%" -c "git add -A && git commit -m '%datestr%' && git push -u origin"
timeout /t 3